<div class="tab_item" style="display:block;">
    <div class="ui_table">
        <form method="post">
            <input type="hidden" name="id" value="${(entity.id)!''}">
            <fieldset>
                <legend>金额分配</legend>
                <div class="ui_table">
                    <table cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="70" align="right">方案名称：</td>
                            <td><input type="text" class="text easyui-validatebox" name="planName" maxlength="40"
                                       required
                                       value="${(entity.planName)!''}"/></td>
                        </tr>
                        <tr>
                            <td align="right">备注：</td>
                            <td><input type="text" class="text easyui-validatebox" name="memo" maxlength="256" required
                                       value="${(entity.memo)!''}"/></td>
                        </tr>
                    </table>
                </div>
            </fieldset>
        </form>
    </div>
</div>
<script>
    (function () {
        var pid = '${pid}',
                win = $('#${pid}'),
                jform = win.find('form'),
                form = jform[0];
        var snapshot = $.toJSON({
            id: '${entity.id}',
            planName: '${(entity.planName)!''}',
            memo: '${(entity.memo)!''}'
        });

        var ok = function () {
            if (!jform.form('validate')) {
                return false;
            }
            var success = true;
            var values = {
                id: form.id.value,
                planName: form.planName.value,
                memo: form.memo.value
            };
            if (snapshot != $.toJSON(values)) {
                $.ajax({
                    cache: false,
                    async: false,
                    type: 'POST',
                    url: '${contextPath}/security/hdw/exchange_amount_money_divide/update.htm',
                    dataType: 'json',
                    data: values,
                    success: function (json) {
                    <@app.json_jump/>
                        if (json.success) {
                        } else {
                            $.messager.alert('提示信息', json.message, 'info');
                            success = false;
                        }
                    }
                });
            }
            return success;
        }
        win.data('ok', ok);
    })();
</script>
